<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %> 
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>财务开票详细</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<div>
            <div id="pageInTab" class="pageInTab">
                    <form id="cust_auditing_add_form">
                        <div class="fieldset1 tabel_col clearFix">
                            <div class="fieldBox col_33">
			                    <div class="label">客户名称</div>
			                    <div class="field">
			                    	<span id="cstNm" name="cstNm"></span>
			                    </div>
			                </div>
                           
			                <div class="fieldBox col_33">
			                    <div class="label">项目所属机构</div>
			                    <div class="field">
			                   		<span id="orgNm" name="orgNm"></span>
			                    </div>
			                </div>
                            <div class="fieldBox col_33">
                                <div class="label">收件人</div>
			                    <div class="field">
			                         <span id="rcverNm" name="rcverNm"></span>
			                    </div>
                            </div>
                            <div class="fieldBox col_33">
			                     <div class="label">联系电话</div>
						        <div class="field">
						            <span id="rcverTel" name="rcverTel"></span>
						        </div>
			                </div>
			                 <div class="fieldBox col_33">
			                     <div class="label">流程发起人姓名</div>
						        <div class="field">
						            <span id="sysUsrRlNm" name="sysUsrRlNm"></span>
						        </div>
			                </div>
			                 <div class="fieldBox col_33">
			                     <div class="label">流程发起人联系电话</div>
						        <div class="field">
						            <span id="sysUsrMp" name="sysUsrMp"></span>
						        </div>
			                </div>
			                <div class="fieldBox col_100">
			                    <div class="label">收件地址</div>
			                    <div class="field">
			                        <span id="rcvAddr" name="rcvAddr"></span>
			                    </div>
			                </div>
			                
			                <div class="fieldBox col_33">
                                <div class="label">快递公司</div>
			                    <div class="field">
			                        <span id="expCorp" name="expCorp"></span>
			                    </div>
                            </div>
                            
                            <div class="fieldBox col_33">
                                <div class="label">快递单号</div>
			                    <div class="field">
			                        <span id="trcNo" name="trcNo"></span>
			                    </div>
                            </div>
                            
                            
                            <div class="fieldBox col_33">
			                    <div class="label">是否提前开票</div>
			                    <div class="field">
			                    	<span id="isPreInv" name="isPreInv"></span>
			                    </div>
			                </div>
			                
			                <div class="fieldBox col_33">
			                     <div class="label">开票人电话</div>
						        <div class="field">
						       	   <span id="invTel" name="invTel"></span>
						        </div>
			                </div>
			                
			                <div class="fieldBox col_33">
			                    <div class="label">开票人开户行</div>
			                    <div class="field">
			                    	<span id="invBkCd" name="invBkCd"></span>
			                    </div>
			                </div>
			                
				            <div class="fieldBox col_33">
			                     <div class="label">开票人帐号</div>
						        <div class="field">
						        	<span id="invAccNo" name="invAccNo"></span>
						        </div>
			                </div>	
			                
			                <div class="fieldBox col_66">
			                     <div class="label">纳税人识别号</div>
						        <div class="field">
						        	<span id="invTaxId" name="invTaxId"></span>
						        </div>
			                </div>

                            <div class="fieldBox col_33">
                                <div class="label">开具方式</div>
                                <div class="field">
                                    <span id="invoiceType" name="invoiceType">纸质发票</span>
                                </div>
                            </div>

                            <div class="fieldBox col_66">
			                    <div class="label">发票抬头</div>
			                    <div class="field">
			                    	<span id="invTitle" name="invTitle"></span>
			                    </div>
			                </div>

                            <div class="fieldBox col_33">
                                <div class="label">客户类型</div>
                                <div class="field">
                                    <span id="cstTypCdNm" name="cstTypCdNm"></span>
                                </div>
                            </div>
			                
			                <div class="fieldBox col_100">
			                    <div class="label">开票地址</div>
			                    <div class="field">
			                    	<span id="invAddr" name="invAddr"></span>
			                    </div>
			                </div>
			                
                            <div class="fieldBox col_100">
									<div class="label">资料</div>
									<div class="field">
					                	<jsp:include page="../../system/sysUlFilesRec/sysUlFileRecListDetail.jsp" flush="true" >
					                   		<jsp:param name="pkId" value="${id }"/>
					                   		<jsp:param name="tabNm" value="PRJ_BILL_APPLY"/>
					                 	</jsp:include>
					                 	<span style="color: red;">提示:若申请开具增值税专用发票,需要上传营业执照或承租人开票信息附件.</span>
						            </div>
							</div>
			                 <!-- hide data -->
					        <div class="fieldBox col_100" style="display:none;">
					          <div class="field">
					              <input name="applyId" id="applyId" type="text" class="ui-textbox" value="${id}">
					              <input name="orgCd" id="orgCd" type="text" class="ui-textbox" value="${orgCd}">
					          </div>
					        </div>
                        </div>	
                    </form>
                    <div class="sqPanel">
                        <div class="sqPanel_head inL">
                            <!-- <div class="btnsBox inLC">
                                <span id="cst_aud_add_btn" onclick="save();" class="sq-button sq-button-hasicon"><i class="sqBtnIco_3"></i>开票</span>
                            </div> -->
                            <span>支付表信息</span>
                        </div>
                        <!-- 支付表列表 -->
                        <jsp:include page="invoiceBscGrid.jsp" flush="true"></jsp:include>
                    </div>
            </div>
        </div>
</div>
	<script>
        var applyId = $("#applyId").val();
		$(function() {
		   initForm();
	       initData();
	       initGrid();
		});
		
		//初始化表单
		function initForm(){
		   $("#cust_auditing_add_form").ligerForm({
                validate: true
           });
		}
		
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}

		//修改初始化数据
		function initData(){
			var applyId = $("#applyId").val();
	    	if(!applyId)return;
	    	var _url = '<%=path%>/invoice/prjbillapply/getById.do';
	    	AjaxUtils.ajaxGet(_url, {id:applyId}, initCallback);
    	}
		
		//初始化回调
		function initCallback(msg){
			if(msg.success == 1){
				 setData(msg.data);//设置数据
			 }else{
				 UIUtils.alertError(msg.info);
			 }
		}
		
		//修改时候设置页面数据
	    function setData(data){
	    	$("#rcverNm").html(data.rcverNm);
	    	$("#rcverTel").html(data.rcverTel);
	    	$("#rcvAddr").html(data.rcvAddr);
	    	$("#expCorp").html(data.expCorp);
	    	$("#trcNo").html(data.trcNo);
	    	$("#cstNm").html(data.cstNm);
	    	$("#orgNm").html(data.buOrgCdNm);
	    	$("#isPreInv").html(data.isPreInvNm);
	    	$("#invTel").html(data.invTel);
	    	$("#invBkCd").html(data.invBkCdNm);
	    	$("#invAccNo").html(data.invAccNo);
	    	$("#invTaxId").html(data.invTaxId);
	    	$("#invTitle").html(data.invTitle);
	    	$("#invAddr").html(data.invAddr);
	    	$("#sysUsrRlNm").html(data.sysUsrRlNm);
	    	$("#sysUsrMp").html(data.sysUsrMp);
            $("#cstTypCdNm").html(data.cstTypNm);
		};
	</script>
</body>
</html>